\section{Introduction}
This documents attempts to explain clearer how the different components of the application interact among themselves. So it will  
give developers a picture of how the system works, and facilitate the learning process of the application's operations.

\section{Model view controller}
To establish the communication between the components we decided to use the model-view-controller. This methodology divides 
the system into the following blocks:
\begin{enumerate}
 \item \emph{Model:} The model manages the behaviour and data of the application domain, responds to requests for information 
      about its state (usually from the view), and responds to instructions to change state (usually from the controller).
 \item \emph{View:} The view renders the model into a form suitable for interaction, a user interface element or the way 
      to communicate a component with the others (API). Multiple views can exist for a single model for different purposes.
 \item \emph{Controller:} The controller receives input and initiates a response by making calls on model objects. A 
      controller accepts input from the user and instructs the model and view port to perform actions based on that input.
\end{enumerate}

\section{Architectural model}
Finally in the \emph{Figure \ref{architecturalmodel} } you can see how is the system's structure.

\begin{figure}[ht]
\centering
\includegraphics[width=1\textwidth ]{Android/Design/images/arquitecture.png} 
\caption{Architectural model}
\label{architecturalmodel}
\end{figure}

\subsection{Components}
The application has been estructured into four main components which has already been defined in previous sections:
\begin{enumerate}
 \item \emph{Android application:} This component includes all the software developed for the Android platform. As you can see 
      the structure of this application is a typical model-view-controller. In the model we have the class KPosition, KUserInfo, 
      Groups, KAuth and so on. For the Controller we have the class CreateComment, PhotoGallery, Maps, GPS, Register, etc, 
      which correspond with the Android Activities. These classes interact with model and view. Finally we have View, which 
      corresponds to the interfaces that are programmed in XML and the Web Service's View which is used to communicate with 
      the server with help of web services.
 \item \emph{Web site application:} This component includes all the software developed for the web site. In this case we have 
      the almost the same structure with the Android application. Also, only in the Web site there is going to be two different 
      types of users, the administrator and the common user. The Web site uses the \emph{ToServer} class so as to communicate
      with Web services with the help of the SOAP protocol.
 \item \emph{Web service server:} This component includes all the software developed to interacts with the database and provide to 
  the Android and web site the functions that they need. Now the View corresponds only an \emph{wsdl} file which is used to communicate 
  with any application that requires something from the database.
  \item \emph{Database: } It's the MySQL's database which stores all the information for both applications.
\end{enumerate}

